package com.lanou3g.ptp.task.service;

import com.github.pagehelper.PageInfo;
import com.lanou3g.ptp.entity.Diary;
import com.lanou3g.ptp.entity.Task;
import com.lanou3g.ptp.entity.TaskGradeItem;
import com.lanou3g.ptp.entity.Teacher;
import com.lanou3g.ptp.exception.PtpException;
import com.lanou3g.ptp.vo.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface TaskService {
    void insert1(TaskVO taskVO, String token);

    //新增一个任务
    void insert(TaskVO taskVO);

    //删除
    void delete(Long id);

    //批量删除
    void deletes(Long[] ids);

    //修改
    void update(Long id, TaskVO taskVO, String token);

    //查询一个
    TaskVO findTaskVOById(Long id);

    Task findById(Long id);

    //查询日志情况
    Map<String, List<Diary>> diarySituation(Long taskId);

    PageInfo<SimpleTask> findDivertTasksByTeachlinkId(Long teachlinkId, Pageable page);

    void updates(Long[] taskIds, Task task);

    /**
     * 获取某个老师所参与的分散式教学环节下的所有学生自主提交的任务
     *
     * @param teacherId
     * @param page
     * @return
     */
    PageInfo<TaskResult> findStuSubmitTasks(Long teacherId, Pageable page);

    boolean passTask(Long teacherId, Long taskId);

    boolean denyTask(Long teacherId, Long taskId);

    void newTask(Long teacherId, TaskBody taskBody) throws PtpException;

    void updateTask(TaskBody taskBody) throws PtpException;

    List<TaskGradeItem> getTaskGradeItemsByTaskId(Long taskId);

    List<Task> findByStudentId(Long studentId);

    Task findTaskDescById(Long taskId);

    CentralTaskResult findCentralTaskByTeachlinkId(Long teachlinkId);

    Task findTaskByTeachlinkId(Long teachlinkId);

    List<Task> findByStatus(Integer status);

    boolean updateStatusById(Integer status, Long taskId);

    void startTask(Long taskId);

    void endTask(Long taskId);

    TaskBody findTaskBodyByTeachlink(Long teachlinkId);

    List<Long> findTaskIdsByTeacher(Teacher teacher);

    List<Task> showByStudentId(Long id);

    List<Task> findByBaseId(Long baseId);

    void updateEvaluate(Long taskId, int evaluate);
}
